﻿
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class PVEPrefs
{
    internal static bool npcpoolGizmos = true;
    internal static Color npcminSpawnZoneColor = Color.yellow;
    public static Color npcmaxSpawnZoneColor = Color.blue;
    public static Color npcactiveZoneColor = Color.red;


    internal static bool CarpoolGizmos = true;
    internal static Color carminSpawnZoneColor = Color.yellow;
    public static Color carmaxSpawnZoneColor = Color.blue;
    public static Color caractiveZoneColor = Color.red;
    [SettingsProvider]
    public static SettingsProvider STSSettingsProvider()
    {
        SettingsProvider provider = new SettingsProvider("Preferences/PVE Traffic System", SettingsScope.User)
        {
            label = "PVE Traffic System",
            guiHandler = (searchContext) =>
            {
                OnGUI();
            },
            keywords = new HashSet<string>(new[] { "PVE", "Traffic", "System" })
        };
        return provider;
    }

    public static void OnGUI()
    {
        EditorGUILayout.Space();
        EditorGUIUtility.wideMode = true;

        EditorGUILayout.BeginVertical("Box");
        EditorGUILayout.LabelField("NpcManager Pool Area Gizmos", EditorStyles.boldLabel);
        npcpoolGizmos = EditorGUILayout.Toggle("Show", npcpoolGizmos);
        npcminSpawnZoneColor = EditorGUILayout.ColorField("最小出生距离", npcminSpawnZoneColor);
        npcmaxSpawnZoneColor = EditorGUILayout.ColorField("最大出生距离", npcmaxSpawnZoneColor);
        npcactiveZoneColor = EditorGUILayout.ColorField("最大存在距离", npcactiveZoneColor);
        EditorGUILayout.EndVertical();
        EditorGUILayout.Space();


        EditorGUILayout.BeginVertical("Box");
        EditorGUILayout.LabelField("Car Pool Area Gizmos", EditorStyles.boldLabel);
        CarpoolGizmos = EditorGUILayout.Toggle("Show", CarpoolGizmos);
        carminSpawnZoneColor = EditorGUILayout.ColorField("最小出生距离", carminSpawnZoneColor);
        carmaxSpawnZoneColor = EditorGUILayout.ColorField("最大出生距离", carmaxSpawnZoneColor);
        caractiveZoneColor = EditorGUILayout.ColorField("最大存在距离", caractiveZoneColor);
        EditorGUILayout.EndVertical();
        EditorGUILayout.Space();

        if (GUI.changed)
        {
            SavePrefs();
            SceneView.RepaintAll();
        }
    }

    private static void SavePrefs()
    {
       
    }
}
